package com.sisgesbyte.web.managedBean.common;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean
@SessionScoped
public class Utilitarios implements Serializable{

	private static final long serialVersionUID = 1L;
	
    private GregorianCalendar calendar;
    private String dateCurrencySystem;
    private String mesActual;
    String[] days={"Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado"};
    String[] month={"Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"};
    
    @PostConstruct
    public void init() {
    	calendar = new GregorianCalendar();
        calendar.setTime(new Date());
        dateCurrencySystem = days[calendar.get(Calendar.DAY_OF_WEEK) - 1] + ", " + 
                             calendar.get(Calendar.DAY_OF_MONTH) + " de " + 
                             month[calendar.get(Calendar.MONTH)] + " del " + calendar.get(Calendar.YEAR);
        mesActual = month[calendar.get(Calendar.MONTH)];
    }
    
    public String getDateCurrencySystem() {
        return dateCurrencySystem;
    }

    public void setDateCurrencySystem(String dateCurrencySystem) {
        this.dateCurrencySystem = dateCurrencySystem;
    }

	public String getMesActual() {
		return mesActual;
	}

	public void setMesActual(String mesActual) {
		this.mesActual = mesActual;
	}
    
}
